
(function() {
	jQuery.extend({

		MessageBox : {
			box:undefined,
			create: function(){
				if(!this.box){
					var html = "<div class='messageBox'>" +
					"<div class='messageBox_back'></div>" +
					"<div class='messageBox_contpanel'>" +
					"<table border='0' cellpadding='0' cellspacing='0'><tr><td class='messageBox_context'></td></tr></table>" +
					"</div>" +
					"</div>";
					this.box = $(html);
					var context = this.box.find(".messageBox\_context");
					$(document.body).append(this.box);
				}else{
					return this.box.find(".messageBox\_context");
				}
				return context;
			},
			info : function(str,config) {
				var context = this.create();
				var zhis = this.box;
				zhis.stop(true);
				zhis.hide();
				context.text(str);
				var delay = 500;
				var callback = undefined;
 
				if (typeof(config)=="object"){
					if(!isNaN(config.delay)){
						delay = config.delay;
					}
					if(typeof(callback )=="function"){
						callback = config.callback;
					}
					
				} 
				zhis.fadeIn(1000, function() {
					if(delay>0){
						zhis.delay(delay).fadeOut(1500,function(){
							if(callback){
								callback();
							}
						});
					}
					
				});
			}

		}

	});
})(jQuery);
